package com.smile.service.entity.services;

import com.alibaba.fastjson.annotation.JSONField;
import lombok.Data;
import lombok.ToString;

import java.io.Serializable;
import java.math.BigDecimal;

@Data
@ToString
public class FlightTaskPrepareData implements Serializable {

    private static final long serialVersionUID = 1L;

    @JSONField(name = "break_point")
    private BreakPoint breakPoint;


//    private String rthAltitude;

    @Data
    @ToString
    public static class BreakPoint implements Serializable {
        private static final long serialVersionUID = 1L;

        @JSONField(name = "index")
        private Integer index;

        @JSONField(name = "progress")
        private BigDecimal progress;

        @JSONField(name = "state")
        private Integer state;

        @JSONField(name = "wayline_id")
        private Integer waylineId;

        @JSONField(name = "rth_mode")
        private Integer rthMode;
    }

    @JSONField(name = "rth_mode")
    private Integer rthMode;

    @JSONField(name = "rth_altitude")
    private Integer rthAltitude;

    @JSONField(name = "executable_conditions")
    private ExecutableConditions executableConditions;

    @Data
    public static class ExecutableConditions implements Serializable {
        private static final long serialVersionUID = 1L;

        @JSONField(name = "storage_capacity")
        private Integer storageCapacity;
    }

    @JSONField(name = "execute_time")
    private Long executeTime;

    @JSONField(name = "exit_wayline_when_rc_lost")
    private Integer exitWaylineWhenRcLost;

    @JSONField(name = "file")
    private File file;

    @Data
    @ToString
    public static class File {
        private static final long serialVersionUID = 1L;

        @JSONField(name = "fingerprint")
        private String fingerPrint;

        @JSONField(name = "url")
        private String url;
    }

    @JSONField(name = "flight_id")
    private String flightId;

    @JSONField(name = "flight_safety_advance_check")
//    private Integer flightSafetyAdvanceCheck;
    private Integer flightSafetyAdvanceCheck;

    @JSONField(name = "out_of_control_action")
    private Integer outOfControlAction;

    @JSONField(name = "ready_conditions")
    private ReadyConditions readyConditions;

    @Data
    @ToString
    public static class ReadyConditions implements Serializable {
        private static final long serialVersionUID = 1L;

        @JSONField(name = "battery_capacity")
        private Integer batteryCapacity;

        @JSONField(name = "begin_time")
        private Long beginTime;

        @JSONField(name = "end_time")
        private Long endTime;
    }

//    @JSONField(name = "rth_altitude")
//    private Integer rthAltitude;

    @JSONField(name = "simulate_mission")
    private SimulateMission simulateMission;

    @Data
    @ToString
    public static class SimulateMission implements Serializable {
        private static final long serialVersionUID = 1L;

        @JSONField(name = "is_enable")
        private Integer isEnable;

        @JSONField(name = "latitude")
        private BigDecimal latitude;

        @JSONField(name = "longitude")
        private BigDecimal longitude;

        @JSONField(name = "altitude")
        private BigDecimal altitude;
    }

    @JSONField(name = "task_type")
    private Integer taskType;

    @JSONField(name = "wayline_precision_type")
    private Integer waylinePrecisionType;

//    @JSONField(name = "execute_time")
//    public Long executeTime;

}
